//
//  WCarouselView.h
//  WCarouselView
//
//  Created by Wanglele on 16/4/25.
//  Copyright © 2016年 Wanglele. All rights reserved.
//

#import <UIKit/UIKit.h>

//滚动方向
typedef enum : NSUInteger
{
    WScrollingDirectionHorizontal,  //水平
    WScrollingDirectionVertical     //垂直
} WScrollingDirection;


@protocol WCarouselViewDelegate;



/**
 *  广告、公告轮播控件
 */
@interface WCarouselView : UIView

#pragma mark - 属性

//滚动方向，水平\垂直
@property(nonatomic,assign)WScrollingDirection scrollingDirection;

//代理
@property(nonatomic,weak)id<WCarouselViewDelegate> delegate;

//是否循环滚动
@property(nonatomic,assign)BOOL isContinuous;

//自动滚动时间
@property(nonatomic,assign)NSTimeInterval autoPlayTime;

#pragma mark - 方法

/**
 *  初始化,且设置滚动方向
 *
 *  @param frame     位置大小
 *  @param direction 滚动方向
 *
 */
-(instancetype)initWithFrame:(CGRect)frame ScrollingDirection:(WScrollingDirection)direction;


-(void)reloadData;



@end



@protocol WCarouselViewDelegate <NSObject>


@required   //------以下为必须实现

//个数
-(NSInteger)numberOfItemsInCarouseView:(WCarouselView*)carouseView;

//每个视图
-(UIView *)carouseView:(WCarouselView*)carouseView indexOfItem:(NSInteger)index;

@optional   //------以下为选择实现

//滑动完成
-(void)carouseView:(WCarouselView*)carouseView indexOfItemWhenDidScroll:(NSInteger)index;

//将要完成
-(void)carouseView:(WCarouselView*)carouseView indexOfItemWhenWillScroll:(NSInteger)index;

//点击
-(void)carouseView:(WCarouselView*)carouseView indexOfItemWhenClick:(NSInteger)index;







@end










